<div ng-controller="RoleCtrl" ng-init="listAction()">
    <ul class="sui-breadcrumb">
        <li><a href="#/role/list">{{'Roles'|translate}}</a></li>
        <li><a href="#/role/add" class="sui-btn btn-primary">+{{'add_new'|translate}}</a></li>
        <span class="sui-form sui-form pull-right"> 
          <input type="text" ng-model="name"  placeholder="{{'Roles'|translate}}" >
          <button class="sui-btn btn-primary" type="submit" ng-click="getRoleList()">{{'search'|translate}}</button>
        </span>
    </ul>
    <table class="sui-table table-bordered">
        <thead>
            <tr>
                <th>#</th>
                <th>{{'Name'|translate}}</th>
                <!-- <th>{{'is_super_admin'|translate}}</th> -->
                <!-- <th>{{'is_sys'|translate}}</th> -->
                <th>{{'资源'|translate}}</th>
                <th>{{'员工'|translate}}</th>
                <th>缓存</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="list in itemslist">
                <td>{{list.role_id}}</td>
                <td nowrap>{{list.name}}</td>
                <!-- <td>{{list.is_super_admin}}</td> -->
                <!-- <td>{{list.is_super_admin}}</td> -->
                <td>
                    <ul class="sui-tag tag-selected">
                        <li ng-repeat="p in list.permissions">
                            {{p.name}}
                        </li>
                    </ul>
                </td>
                <td nowrap><a ng-if="!list.is_super_admin" href="#/role/add?role_id={{list.role_id}}&chosed_type=5" class="sui-btn btn-primary">添加员工</a><a ng-if="list.is_super_admin" href="#/role/user?role_id={{list.role_id}}" class="sui-btn btn-primary">添加员工</a></td>
                <td nowrap>
                    <button class="sui-btn btn-success" ng-if="list.is_forward_msg==0" ng-click="setKefu(list,1)">更新</button>
                    <button class="sui-btn btn-danger" ng-if="list.is_forward_msg==1" ng-click="setKefu(list,0)">更新</button>
                </td>
                <td nowrap>
                    <a ng-if="!list.is_sys" href="#/role/add?role_id={{list.role_id}}" class="sui-btn btn-primary">{{'edit'|translate}}</a>
                    <button ng-if="!list.is_sys" ng-click="delAction(list.role_id)" class="sui-btn btn-danger">{{'delete'|translate}}</button>
                </td>
            </tr>
        </tbody>
    </table>
    <!-- 分页start -->
    <pager page-no="1" page-size="pageSize" total="itemsTotal" get-data="getRoleList(pageNo)"></pager>
    <!-- 分页end -->

</div>